/**
 * routes是一个数组，数组中的每一个对象是一个路由对象，路由中常用的属性
 * path:路径:以/作为开头的
 * component:组件
 */
import DiscoveryMusic from '@/views/DiscoveryMusic.vue'
import MyMusic from '@/views/MyMusic.vue'
import FriendMusic from '@/views/FriendMusic.vue'
import Tuijian from '@/views/Tuijian.vue'
import Paihangbang from '@/views/Paihangbang.vue'
import GeDan from '@/views/GeDan.vue'
import ZhuBoDianTai from '@/views/ZhuBoDianTai.vue'
import GeShou from '@/views/GeShou.vue'
import XinDieShangJia from '@/views/XinDieShangJia.vue'
import CategoryArt from '@/views/CategoryArt.vue'

const routes=[
    {
        path:'/discovery',
        component:DiscoveryMusic,
        children:[
            {
                path:'recomm',//嵌套路由如果不以/开头，它的path就是路由的path+自己路由的path
                component:Tuijian
            },
            {
                path:'toplist',
                component:Paihangbang
            },
            {
                path:'playlist',
                component:GeDan
            },
            {
                path:'djradio',
                component:ZhuBoDianTai
            },
            {
                path:'artist',
                component:GeShou,
                children:[
                    {
                        name:'CategoryArt',
                        path:'cat/:cid',
                        component:CategoryArt
                    }
                ]
            },
            {
                path:'album',
                component:XinDieShangJia
            }
        ]
    },
    {
        path:'/my',
        component:MyMusic
    },
    {
        path:'/friend',
        component:FriendMusic
    }
]
export default routes